The invention is based on an electromagnet as generally described hereinafter. In an electromagnet which is already known, however, the electrical connection between contact prongs protruding from the housing and the magnetic coil is effected by welding or soldering. The disadvantage of this is that it is not possible to fabricate the housing and the magnetic coil separately.